#ifndef BOSS_Afterburner_AxisNamed_H
#define BOSS_Afterburner_AxisNamed_H

#include "Containers/AxisBinning.h"
#include "NamedObject.h"
#include "TString.h"
#include <yaml-cpp/yaml.h>

/// @addtogroup Afterburner_objects
/// @{

/// Container object for the binning for *one* axis.
/// Only contains the number of bins, the bin width and the plot range (from to).
/// @author   Remco de Boer 雷穆克 (r.e.deboer@students.uu.nl or remco.de.boer@ihep.ac.cn)
/// @date     April 12th, 2019
class AxisNamed : public NamedObject, public AxisBinning
{
public:
  AxisNamed() {}
  AxisNamed(const TString& input) { Import(input); }
  AxisNamed(const YAML::Node& input) { Import(input); }

  void Import(const TString& input);
  void Import(const YAML::Node& input);
  void ImportNamingAndBinning(const TString& input);
  void ImportNaming(const TString& input);

  void SetUnit(const TString& unit) { fUnit = unit; }
  void SetUnit(const YAML::Node& unit);
  void SetName(const YAML::Node& name);
  void SetTitle(const YAML::Node& title);

  const Bool_t HasUnit() const { return !fUnit.EqualTo(""); }

  const char* GetUnit() const { return fUnit.Data(); }

  const TString BuildAxisLabel() const;
  const TString BuildCountLabel() const;

  virtual const TString BuildString() const;

private:
  TString fUnit;
};

/// @}
#endif